#pragma once
#include "GLTools.h"
class Texture2D;
#define  MAX_TEXTURE_UNIT 32
class Shader
{
public:
	Shader(const char* vsUrl, const char* fsUrl);
	~Shader();

	void Apply();

	void SetTexture2D(const char* locationName, Texture2D *texture);

private:
	static GLuint CompileShader(GLenum shaderType, const char *url);

	static GLuint CreateShaderProgram(const char* vs, const char *fs);

public:

	GLint std_position_location, std_normal_location, std_texcoord_location;

	GLint std_model_mat_location, std_view_mat_location, std_proj_mat_location;

private:
	GLuint program;

	bool textureUnit[MAX_TEXTURE_UNIT];
};

